package SwingModel;

import java.io.File;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import JDBC.CmsDatabaseConnection;
import JDBC.PeopleActivities;

public class CmsAssignmentSubmission{
	
	private final int asgmSubID;
	private final String studentId ;
	private final int asgmID;
	private List<File> subFiles;
	private final double givenPoint;
	private final Date createdDate;
	
	
	public CmsAssignmentSubmission(int asgmSubID, String studentId, int asgmID,
			List<File> subFiles,Date createdDate, double givenPoint) {
		this.asgmSubID = asgmSubID;
		this.studentId = studentId;
		this.asgmID = asgmID;
		this.subFiles = subFiles;
		this.givenPoint = givenPoint;
		this.createdDate = createdDate;
	}
	
	@Override
	public String toString(){
		SimpleDateFormat sdf = new SimpleDateFormat("YYYY:MM:dd HH:mm:ss");
		StringBuilder returnString = new StringBuilder();
		returnString.append("Assignment Submission: \n"
				+ "asgmID: " + asgmID + "\n"
				+ "asgmSubID: " + asgmSubID + "\n"
				+ "studentID: " + studentId + "\n"
				+ "createdDate: " + sdf.format(createdDate) + "\n"			
				+ "givenPoint: " + givenPoint + "\n");
		
		int i=1;
		for(File f : subFiles){
			returnString.append("File" + i + ": " + f.getPath() + "\n");
		}
		
		return returnString.toString();
	}
	
	public int getAsgmSubID() {
		return asgmSubID;
	}
	public String getStudentId() {
		return studentId;
	}
	public int getAsgmID() {
		return asgmID;
	}
	public List<File> getSubFiles() {
		return subFiles;
	}
	public double getGivenPoint() {
		return givenPoint;
	}

	public Date getCreatedDate() {
		return createdDate;
	}
	
	public void setSubFiles(List<File> listOfFile){
		this.subFiles = listOfFile;
	}

	

}
